<?php


class IncomeTaxCell extends BoardCell{

	private $percentage = 0;
	private $flat_fee	= 0; 

	public function __construct($config)
	{
		$this->percentage = $config['percentage'];
		$this->flat_fee   = $config['flat_fee'];
		
		parent::__construct($config);
		
	}
	
	public function landOnPlayerAction($player)
	{
		$player_money = $player->getMoney();
		$player_percentage = $player_money * $this->percentage;
		if($player_percentage < $this->flat_fee)
		{
			$player->removeMoney($player_percentage);
		}
		else{
			$player->removeMoney($this->flat_fee);
		}
		
	}

}